package manager.dao;

import manager.bean.Staff;
import manager.util.JDBC;

import java.util.List;

public class StaffDao {
    public List<Staff> getStaff(String sql, Object... params) {
        if (params==null){
            params=new Object[0];
        }
        List<Staff> list = JDBC.query(sql, Staff.class,params);
        return list;
    }

    public int deleteStaff (String sql,Object... params){
        int count = JDBC.delete(sql,params);
        return count;
    }
    public int addStaff(String sql,Object... params){
        int count = JDBC.insert(sql,params);
        return count;
    }
    public int editStaff(String sql,Object... params){
        int count = JDBC.update(sql,params);
        return count;
    }
    public int countStaff(String sql,Object... params){
        int count = JDBC.queryNum(sql,params);
        return count;
    }
}
